-
-
Couldn't load subscription status.
- Fork 399
feat: limit broadcast payload size #1588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d7faa75 to
219e6cc
Compare
| Process.sleep(120) | ||
|
|
||
| refute_received {:socket_push, :text, _} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Process.sleep(120) | |
| refute_received {:socket_push, :text, _} | |
| refute_receive {:socket_push, :text, _}, 120 |
| Process.sleep(120) | ||
|
|
||
| refute_received {:socket_push, :text, _} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Process.sleep(120) | |
| refute_received {:socket_push, :text, _} | |
| refute_receive {:socket_push, :text, _}, 120 |
| Process.sleep(120) | ||
|
|
||
| refute_received {:socket_push, :text, _} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Process.sleep(120) | |
| refute_received {:socket_push, :text, _} | |
| refute_receive {:socket_push, :text, _}, 120 |
| Process.sleep(120) | ||
|
|
||
| refute_received {:socket_push, :text, _} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Process.sleep(120) | |
| refute_received {:socket_push, :text, _} | |
| refute_receive {:socket_push, :text, _}, 120 |
| messages: list(%{id: String.t(), topic: String.t(), payload: map(), event: String.t(), private: boolean()}) | ||
| }, | ||
| super_user :: boolean() | ||
| ) :: :ok | {:error, atom()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So does it return :ok | {:error, atom() | changeset ? Should it be {:error, changeset} to be consistent?
|
|
||
| @doc """ | ||
| """ | ||
| @spec validate_payload_size(Tenant.t() | binary(), map()) :: :ok | {:error, :payload_size_exceeded} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we update PresenceHandler to also use this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few comments but other than those LGTM
Limits broadcasting messages with payloads bigger than what the tenant as set as the limit
ffe3480 to
aec1438
Compare
aec1438 to
8f4c4c7
Compare
|
🎉 This PR is included in version 2.57.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
| {:noreply, state} | ||
| else | ||
| {:error, %Ecto.Changeset{valid?: false} = changeset} -> | ||
| error = Ecto.Changeset.traverse_errors(changeset, &elem(&1, 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
| end | ||
|
|
||
| def call(conn, %Ecto.Changeset{valid?: true} = changeset) do | ||
| def call(conn, {:error, %Ecto.Changeset{valid?: false} = changeset}) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiling 10 files (.ex)
warning: this clause cannot match because a previous clause at line 32 always matches
│
48 │ def call(conn, {:error, %Ecto.Changeset{valid?: false} = changeset}) do
│ ~
│
└─ lib/realtime_web/controllers/fallback_controller.ex:48:7
What kind of change does this PR introduce?
Limits broadcasting messages with payloads bigger than what the tenant as set as the limit